//
//  TDArae.m
//  TFB
//
//  Created by Nothing on 15/3/23.
//  Copyright (c) 2015年 TD. All rights reserved.
//

#import "TDProvince.h"

@implementation TDProvince

- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if (self) {
        self.provId = [dictionary objectForKey:@"provId"];
        self.provName = [dictionary objectForKey:@"provName"];
        self.cityList = [NSMutableArray array];
        NSArray *cityList = [dictionary objectForKey:@"cityList"];
        [cityList enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
            [self.cityList addObject:[[TDCity alloc] initWithDictionary:obj]];
        }];
    }
    return self;
}

@end

@implementation TDCity

- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if (self) {
        self.cityId = [dictionary objectForKey:@"cityId"];
        self.cityName = [dictionary objectForKey:@"cityName"];
        self.areaList = [NSMutableArray array];
        NSArray *cityList = [dictionary objectForKey:@"areaList"];
        [cityList enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
            [self.areaList addObject:[[TDArea alloc] initWithDictionary:obj]];
        }];
    }
    return self;
}

@end


@implementation TDArea

- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if (self) {
        self.areaId = [dictionary objectForKey:@"areaId"];
        self.areaName = [dictionary objectForKey:@"areaName"];
        self.bankcode = [dictionary objectForKey:@"bankcode"];
    }
    return self;
}

@end


